package com.spider.im.sms.controller;

import com.spider.im.common.annotation.IgnoreLog;
import com.spider.im.common.aspect.RespResult;
import com.spider.im.sms.service.SmsService;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@Tag(name = "SmsController",  description = "短信管理")
@RequestMapping("/api/sms")
@RestController
public class SmsController {

    @Resource
    private SmsService smsService;

    @IgnoreLog
    @Schema(description = "发送验证码")
    @PostMapping("/send-code")
    public RespResult<String> sendSmsCode(@RequestParam("phone") String phone) throws Exception {

        return RespResult.success(smsService.sendVerificationCode(phone));
    }

}
